package com.aspsine.multithreaddownload.db;


import ohos.app.Context;
import ohos.data.DatabaseHelper;;
import ohos.data.rdb.RdbStore;
/**
 * Created by aspsine on 15-4-19.
 */
public class DBOpenHelper extends DatabaseHelper {

    private static final String DB_NAME = "download.db";
    private static final int DB_VERSION = 1;

    public DBOpenHelper(Context context) {
       //TODO 根据hos API 更改 super(context, DB_NAME, null, DB_VERSION);
        super(context);
    }

    void createTable(RdbStore db){
        ThreadInfoDao.createTable(db);
    }

    void dropTable(RdbStore db){
        ThreadInfoDao.dropTable(db);
    }

    public void onCreate(RdbStore db) {
        createTable(db);
    }

    public void onUpgrade(RdbStore db, int oldVersion, int newVersion) {
        dropTable(db);
        createTable(db);
    }
}
